//
//  JYHomeTableViewProxy.m
//  JYFarm
//
//  Created by 花花 on 2017/10/28.
//  Copyright © 2017年 花花. All rights reserved.
//

#import "JYHomeTableViewProxy.h"
#import "JYPublicCell.h"
@implementation JYHomeTableViewProxy

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.dataArray.count;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    JYPublicCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RightCellID"];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    JYWeakSelf;
      cell.homeModel = [self.dataArray safeObjectAtIndex:indexPath.row];
    cell.selectStarsBtnClick = ^(BOOL isSelected){
        
        if (weakSelf.ShopHandlerSelectBlock) {
            weakSelf.ShopHandlerSelectBlock(isSelected,indexPath);
        }
    };
    cell.ShopCountEditBlock = ^(NSInteger count){
        if (weakSelf.ShopCartHandlerChangeCountBlock) {
            weakSelf.ShopCartHandlerChangeCountBlock(count, indexPath);
        }
    };
    return cell;
}

@end
